package com.yangguang.huahui.mvp.presenter;

import com.yangguang.huahui.entity.Contact;
import com.yangguang.huahui.mvp.model.NewsModel;
import com.yangguang.huahui.mvp.view.ContactView;
import com.yangguang.huahui.rx.RxManager;
import com.yangguang.huahui.rx.RxSubscriber;

/**
 * Created by Administrator on 2017/3/23.
 */

public class FriendsPresenter extends BasePresenter<ContactView>{
    NewsModel model;

    public FriendsPresenter() {
        model = new NewsModel();
    }
    public void getFriends(String uid, String keywords){
        mSubscription = RxManager.getInstance().doSubscribe(model.getFriends(uid, keywords), new RxSubscriber<Contact>(false) {
            @Override
            protected void _onNext(Contact contact) {
                mView.onSuccess(contact);
            }

            @Override
            protected void _onError() {
                mView.onError();
            }
        });
    }
}
